package com.example.springboot_mq_dlx_pro.producer;

import com.example.springboot_mq_dlx_pro.config.RabbitConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;

/*
			  ________   ___   ___        ___   ________   ___   ___        ___
	 ________|\   __  \_|\  \_|\  \______|\  \_|\   __  \_|\  \_|\  \______|\  \_________
	 \       \ \  \_\ /_\ \  \\ \  \     \ \  \\ \  \_\ /_\ \  \\ \  \     \ \  \        \
	  \       \ \   __  \\ \  \\ \  \     \ \  \\ \   __  \\ \  \\ \  \     \ \  \        \
	   \       \ \  \_\  \\ \  \\ \  \____ \ \  \\ \  \_\  \\ \  \\ \  \____ \ \  \        \
	    \       \ \_______\\ \__\\ \_______\\ \__\\ \_______\\ \__\\ \_______\\ \__\        \
	     \       \|_______| \|__| \|_______| \|__| \|_______| \|__| \|_______| \|__|         \
	 	  \___________________________________________________________________________________\

+------------+
|2020/5/4   |
|21:03       |
+------------+
*/
public class SendMessage {
    @Autowired
    private AmqpTemplate template;

    public void send() {
        for (int i = 0; i < 10; i++) {
            template.convertAndSend(RabbitConfig.DELAY_QUEUE_PER_QUEUE_TTL_NAME,"ttl message----- "+i);
        }
    }
}
